<?php
class ui_circle_show_member_list extends ui {
	/**
	 *
	 * @param object $S
	 * @param array $param = array (
	 * 			id			// circle id
	 * 			page
	 * )
	 */
	public function __construct($S, $param) {
		parent::__construct();
		
		$limit = 30;
		$data_circle = new data_circle();
		$member = $data_circle->list_member($this->uid, $param['id'], $param['page'], $limit);
		
		// 判断第一页和最后一页
		$is_last = 0;
		if ($param['page'] > 1 and empty($member)) {					// 不是第一页，而且没有数据了，那么一定就是最后一页了
			$is_last = 1;
			$param['page'] = $param['page'] - 1;
			$member = $data_circle->list_member($this->uid, $param['id'], $param['page'], $limit);
		}
		
		$S->assign('is_last', 	$is_last);
		$S->assign('page', 		$param['page']);

		if (is_array($member)) {
			
			$member_access = $data_circle->get_access($this->uid, $param['id']);
			
			$S->assign('member', 		$member);
			$S->assign('member_access', 	$member_access);
			$S->assign('circle_id', 		intval($param['id']));
		}
	}
}
?>